import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  // {
  //   path: '/',
  //   name: 'Home',
  //   component: Home
  // },
  {
    path: "/login",
    name: "Login",
    component: () => import("../views/Login/index.vue"), // 路由懒加载  注释表示打包分类
  },
  {
    path: "/reg",
    name: "register",
    component: () => import("../views/Reg/index.vue"), // 路由懒加载  注释表示打包分类
  },

  /* 首页入口 */
  {
    path: "/",
    component: () => import("../views/layout/index.vue"),
    children: [
      { path: "", component: () => import("../views/Home/index.vue") },
      {
        path: "artcategory",
        component: () => import("../views/art/artcategory.vue"),
      },
      { path: "artlist", component: () => import("../views/art/artlist.vue") },
      {
        path: "userinfo",
        component: () => import("../views/user/userinfo.vue"),
      },
      {
        path: "changeavatar",
        component: () => import("../views/user/changeavatar.vue"),
      },
      {
        path: "resetpwd",
        component: () => import("../views/user/resetpwd.vue"),
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
